home *** CD-ROM | disk | FTP | other *** search
/ develop, the CD; issue 1 / Apple_Develop_1989.bin / Realistic Color / RW Fragment / RW Fragment.c < prev    next >
C/C++ Source or Header  |  1989-10-05  |  804b  |  40 lines

  1. /* Real World QD code fragment */
  2. /* Test for Color QD and 32-Bit QD */
  3. /* If Color QD and 32-BitQD are present, then nothing happens in the demo. */
  4. /* If they are missing, you get a window with the message. */
  5.  
  6. #define QD32Trap    0xAB03
  7. #define UnImplTrap    0xA89F
  8. #define False 0
  9. #define True 1
  10.     
  11. PutUpInformativeMessage()
  12. {
  13.      printf("\n 32-Bit QuickDraw is not implemented."); 
  14. }
  15.  
  16. QD32Exists()
  17. {    
  18.     short error;
  19.     Boolean result = False;            /* Assume not there */
  20.     SysEnvRec theWorld;
  21.     
  22.     error = SysEnvirons (1, &theWorld);
  23.     
  24.     if (theWorld.hasColorQD)
  25.     result = (NGetTrapAddress (QD32Trap, ToolTrap) !=
  26.            NGetTrapAddress (UnImplTrap, ToolTrap));
  27.            
  28.     return result;
  29. }
  30.  
  31.  
  32. main()
  33. {    
  34.     Boolean QD32IsImplemented;
  35.  
  36.     QD32IsImplemented = QD32Exists();
  37.     if (!QD32IsImplemented)
  38.         PutUpInformativeMessage();
  39.         
  40. }